mouseDown
Type
message
Summary
Sent when the user presses the mouse button.
Syntax
mouseDown <pButtonNumber>
Description
Handle the mouseDown message to perform an action when the user presses the mouse button, before the mouse button is released.
The mouseDown message is sent to the control that was clicked, or to the card if no control was under the mouse pointer.
If the Browse tool is being used, and you click an unlocked field with mouse button 1 or 2, no mouseDown message is sent. If you click with mouse button 3, the mouseDown message is sent even though the field is not locked.
If the user clicks a transparent pixel in an image, the mouseDown message is sent to the object behind the image, not to the image.
Parameters
Name | Type | Description |
---|---|---|
pButtonNumber | enum | Specifies which mouse button was pressed: |
Examples
# show popup menu on Right-click/Control-click (Mac OS)
# assumes presence of a popup-style menu button, "Configure"
on mouseDown theButton
if theButton is 3 then
popup button "Configure"
else
pass mouseDown
end if
end mouseDown
# To let the user click and drag an object
# put this handler in the object's script
on mouseDown
grab me
end mouseDown
Related
command: grab
function: mouseClick
glossary: field, pixel, mouse button, lock, message, card, mouse pointer, image, object
keyword: control
message: scrollbarBeginning, scrollbarLineInc, mouseDown, mouseStillDown
property: repeatDelay
Compatibility and Support
Introduced
LiveCode 1.0
OS
mac
windows
linux
ios
android
web
Platforms
desktop
server
mobile